﻿<%@ Page Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="DrDp.aspx.cs" Inherits="InventoryTracker_DrDp" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">

<div>        
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" DataSourceID="TDBDS"
            OnRowDataBound="GridView1_RowDataBound" 
            OnRowCommand="GridView1_RowCommand" OnRowUpdating="GridView1_RowUpdating" 
            AllowSorting="True" AllowPaging="True" PageSize="4">
            <Columns>                
                <asp:BoundField DataField="InvoiceNumber" HeaderText="InvoiceNumber" 
                    SortExpression="InvoiceNumber" />
                <asp:BoundField DataField="InvoiceItem" HeaderText="InvoiceItem" 
                    SortExpression="InvoiceItem" />
                <asp:BoundField DataField="InvoiceItemRate" HeaderText="InvoiceItemRate" 
                    SortExpression="InvoiceItemRate" />
                <asp:BoundField DataField="InvoiceItemQty" HeaderText="InvoiceItemQty" 
                    SortExpression="InvoiceItemQty" />
                <asp:BoundField DataField="Tax" HeaderText="Tax" SortExpression="Tax" />
                <asp:BoundField DataField="InvoiceDiscount" HeaderText="InvoiceDiscount" 
                    SortExpression="InvoiceDiscount" />
                <asp:BoundField DataField="InvoiceTotalAmount" HeaderText="InvoiceTotalAmount" 
                    SortExpression="InvoiceTotalAmount" />
                <asp:BoundField DataField="InvoiceDate" HeaderText="InvoiceDate" 
                    SortExpression="InvoiceDate" />
            </Columns>
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle CssClass="headerStyle" ForeColor="White" BackColor="#507CD1" 
                Font-Bold="True" />
            <RowStyle CssClass="rowStyle" BackColor="#EFF3FB" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle CssClass="alternatingRowStyle" BackColor="White" />
            <FooterStyle CssClass="footerStyle" BackColor="#507CD1" Font-Bold="True" 
                ForeColor="White" />
            <PagerStyle CssClass="pagerStyle" ForeColor="White" BackColor="#2461BF" 
                HorizontalAlign="Center" />
        </asp:GridView>
        <asp:SqlDataSource ID="TDBDS" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString36 %>" 
            DeleteCommand="DELETE FROM InvoiceDetails WHERE (InvoiceNumber = @InvoiceNumber)" 
            InsertCommand="INSERT INTO InvoiceDetails(InvoiceItem, InvoiceItemRate, Tax, InvoiceTotalAmount, InvoiceDate, InvoiceItemQty, InvoiceDiscount) VALUES (@InvoiceItem, @InvoiceItemRate, @Tax, @InvoiceTotalAmount, @InvoiceDate, @InvoiceItemQty, @InvoiceDiscount)" 
            SelectCommand="SELECT InvoiceDetails.* FROM InvoiceDetails" 
            UpdateCommand="UPDATE InvoiceDetails SET InvoiceItem = @InvoiceItem, InvoiceItemRate = @InvoiceItemRate, Tax = @Tax, InvoiceTotalAmount = @InvoiceTotalAmount, InvoiceDate = @InvoiceDate, InvoiceItemQty = @InvoiceItemQty, InvoiceDiscount = @InvoiceDiscount WHERE (InvoiceNumber = @InvoiceNumber)">
            <DeleteParameters>
                <asp:Parameter Name="InvoiceNumber" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="InvoiceItem" />
                <asp:Parameter Name="InvoiceItemRate" />
                <asp:Parameter Name="Tax" />
                <asp:Parameter Name="InvoiceTotalAmount" />
                <asp:Parameter Name="InvoiceDate" />
                <asp:Parameter Name="InvoiceItemQty" />
                <asp:Parameter Name="InvoiceDiscount" />
                <asp:Parameter Name="InvoiceNumber" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="InvoiceItem" />
                <asp:Parameter Name="InvoiceItemRate" />
                <asp:Parameter Name="Tax" />
                <asp:Parameter Name="InvoiceTotalAmount" />
                <asp:Parameter Name="InvoiceDate" />
                <asp:Parameter Name="InvoiceItemQty" />
                <asp:Parameter Name="InvoiceDiscount" />
            </InsertParameters>
        </asp:SqlDataSource>
        <br /><br />
        <asp:Label id="Message" runat="server" CssClass="message"></asp:Label> 
        
       
        
     </div>


</asp:Content>

